package main

import "math"

func main() {
	println(increasingTriplet([]int{2, 1, 5, 0, 4, 6}))
}

func increasingTriplet(nums []int) bool {
	n := len(nums)
	if n < 3 {
		return false
	}
	first := nums[0]
	second := math.MaxInt32
	for i := 1; i < n; i++ {
		if nums[i] > second {
			return true
		} else if first < nums[i] {
			second = nums[i]
		} else {
			first = nums[i]
		}

	}
	return false
}
